package com.weijin.model.entities;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.weijin.model.enums.OperationStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 请假实体类
 *
 * @Author WeiJin
 * @Version 1.0
 * @Date 2025/3/28 19:22
 */
@ApiModel("请假实体类")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Vacation {
    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty("请求id")
    private String id;
    @ApiModelProperty("请假人id")
    @TableField("user_id")
    private String userId;
    @ApiModelProperty("请假类型 1病假2时间3产假4陪产假")
    @TableField("type")
    private Integer type;
    @ApiModelProperty("开始时间")
    private LocalDate startDate;
    @ApiModelProperty("结束时间")
    private LocalDate endDate;
    @ApiModelProperty("请假原因")
    private String reason;
    @ApiModelProperty("是否同意")
    private OperationStatus isAgree;
    @ApiModelProperty("审批人id")
    private String operatorId;
    @ApiModelProperty("操作时间")
    private LocalDateTime operateTime;

    public Vacation(String userId, Integer type, LocalDate startDate, LocalDate endDate, String reason) {
        this.userId = userId;
        this.type = type;
        this.startDate = startDate;
        this.endDate = endDate;
        this.reason = reason;
    }
}
